package com.tanhua.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.dubbo.api.db.DimensionApi;
import com.tanhua.dubbo.api.mapper.DimensionMapper;
import com.tanhua.model.db.Dimension;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @description:
 * @author: Jin L
 * @date: 2021/12/27 11:40
 */
@DubboService
public class DimensionApiImpl implements DimensionApi {

    @Autowired
    private DimensionMapper dimensionMapper;

    @Override
    public Dimension findTypeByName(String maxValue) {
        QueryWrapper<Dimension> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("name", maxValue);
        return dimensionMapper.selectOne(queryWrapper);
    }
}
